home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / mail / pine3.96.tar.gz / pine3.96.tar / pine3.96 / pine / osdep / os-gso.h < prev    next >
C/C++ Source or Header  |  1996-06-19  |  15KB  |  408 lines

  1. /*----------------------------------------------------------------------
  2.   $Id: os-gso.h,v 4.9 1996/06/19 18:12:29 mikes Exp $
  3.  
  4.             T H E    P I N E    M A I L   S Y S T E M
  5.  
  6.    Laurence Lundblade and Mike Seibel
  7.    Networks and Distributed Computing
  8.    Computing and Communications
  9.    University of Washington
  10.    Administration Builiding, AG-44
  11.    Seattle, Washington, 98195, USA
  12.    Internet: lgl@CAC.Washington.EDU
  13.              mikes@CAC.Washington.EDU
  14.  
  15.    Please address all bugs and comments to "pine-bugs@cac.washington.edu"
  16.  
  17.  
  18.    Pine and Pico are registered trademarks of the University of Washington.
  19.    No commercial use of these trademarks may be made without prior written
  20.    permission of the University of Washington.
  21.  
  22.    Pine, Pico, and Pilot software and its included text are Copyright
  23.    1989-1996 by the University of Washington.
  24.  
  25.    The full text of our legal notices is contained in the file called
  26.    CPYRIGHT, included with this distribution.
  27.  
  28.  
  29.    Pine is in part based on The Elm Mail System:
  30.     ***********************************************************************
  31.     *  The Elm Mail System  -  Revision: 2.13                             *
  32.     *                                                                     *
  33.     *             Copyright (c) 1986, 1987 Dave Taylor              *
  34.     *             Copyright (c) 1988, 1989 USENET Community Trust   *
  35.     ***********************************************************************
  36.  
  37.  
  38.   ----------------------------------------------------------------------*/
  39.  
  40. #ifndef _OS_INCLUDED
  41. #define _OS_INCLUDED
  42.  
  43.  
  44. /*----------------------------------------------------------------------
  45.  
  46.    This first section has some constants that you may want to change
  47.    for your configuration.  This is the gso version of the os.h file.
  48.    Further down in the file are os-dependent things that need to be set up
  49.    correctly for each os.  They aren't interesting, they just have to be
  50.    right.  There are also a few constants down there that may be of
  51.    interest to some.
  52.  
  53.  ----*/
  54.  
  55. /*----------------------------------------------------------------------
  56.    Define this if you want the disk quota to be checked on startup.
  57.    Of course, this only makes sense if your system has quotas.  If it doesn't,
  58.    there should be a dummy disk_quota() routine in os-xxx.c so that defining
  59.    this won't be harmful anyway.
  60.  ----*/
  61. /* #define USE_QUOTAS  /* comment out if you never want quotas checked */
  62.  
  63.  
  64.  
  65. /*----------------------------------------------------------------------
  66.    Define this if you want to allow the users to change their From header
  67.    line when they send out mail.  The users will still have to configure
  68.    either default-composer-hdrs or customized-hdrs to get at the From
  69.    header, even if this is set.
  70.  ----*/
  71. /* #define ALLOW_CHANGING_FROM  /* comment out to not allow changing From */
  72.  
  73.  
  74.  
  75. /*----------------------------------------------------------------------
  76.    Define this if you want to allow users to turn on the feature that
  77.    enables sending to take place in a fork()'d child.  This may reduce
  78.    the time on the user's wall clock it takes to post mail.
  79.    NOTE: You'll also have to make sure the appropriate osdep/postreap.*
  80.          file is included in the os-*.ic file for your system.
  81.  ----*/
  82. #define BACKGROUND_POST  /* comment out to disable posting from child */
  83.  
  84.  
  85.  
  86. /*----------------------------------------------------------------------
  87.     Turn this on if you want to disable the keyboard lock function.
  88.  ----*/
  89. /* #define NO_KEYBOARD_LOCK */
  90.  
  91.  
  92.  
  93. /*----------------------------------------------------------------------
  94.     Turn this on to trigger QP encoding of sent message text if it contains
  95.   "From " at the beginning of a line or "." on a line by itself.
  96.  ----*/
  97. /* #define ENCODE_FROMS */
  98.  
  99.  
  100.  
  101. /*----------------------------------------------------------------------
  102.     Timeouts (seconds)
  103.  ----*/
  104. #define DF_MAILCHECK      "150" /* How often to check for new mail, by
  105.                    default.  There's some expense in doing
  106.                    this so it shouldn't be done too
  107.                    frequently.  (Can be set in config
  108.                    file now.)  */
  109.  
  110. /*----------------------------------------------------------------------
  111.     Check pointing (seconds)
  112.  ----*/
  113. #define CHECK_POINT_TIME (7*60) /* Check point the mail file (write changes
  114.                    to disk) if more than CHECK_POINT_TIME
  115.                    seconds have passed since the first
  116.                    change was made.  Depending on what is
  117.                    happening, we may wait up to three times
  118.                    this long, since we don't want to do the
  119.                    slow check pointing and irritate the user. */
  120.                                      
  121. #define CHECK_POINT_FREQ   (12) /* Check point the mail file if there have been
  122.                                    at least this many (status) changes to the
  123.                    current mail file.  We may wait longer if
  124.                    it isn't a good time to do the checkpoint. */
  125.  
  126.  
  127.  
  128. /*----------------------------------------------------------------------
  129.  In scrolling through text, the number of lines from the previous
  130.  screen to overlap when showing the next screen.  Usually set to two.
  131.  ----*/
  132. #define    DF_OVERLAP    "2"
  133.  
  134.  
  135.  
  136. /*----------------------------------------------------------------------
  137.  When scrolling screens, the number of lines from top and bottom of
  138.  the screen to initiate single-line scrolling.
  139.  ----*/
  140. #define    DF_MARGIN    "0"
  141.  
  142.  
  143.  
  144. /*----------------------------------------------------------------------
  145.  Default fill column for pine composer and maximum fill column.  The max
  146.  is used to stop people from setting their custom fill column higher than
  147.  that number.  Note that DF_FILLCOL is a string but MAX_FILLCOL is an integer.
  148.  ----*/
  149. #define    DF_FILLCOL    "74"
  150. #define    MAX_FILLCOL    80
  151.  
  152.  
  153.  
  154. /*----- System-wide config file ----------------------------------------*/
  155. #define SYSTEM_PINERC             "/usr/local/lib/pine.conf"
  156. #define SYSTEM_PINERC_FIXED       "/usr/local/lib/pine.conf.fixed"
  157.  
  158.  
  159.  
  160. /*----------------------------------------------------------------------
  161.    The default folder names and folder directories (some for backwards
  162.    compatibility).  Think hard before changing any of these.
  163.  ----*/
  164. #define DF_DEFAULT_FCC            "sent-mail"
  165. #define DEFAULT_SAVE              "saved-messages"
  166. #define POSTPONED_MAIL            "postponed-mail"
  167. #define POSTPONED_MSGS            "postponed-msgs"
  168. #define INTERRUPTED_MAIL          ".pine-interrupted-mail"
  169. #define DEADLETTER                "dead.letter"
  170. #define DF_MAIL_DIRECTORY         "mail"
  171. #define INBOX_NAME                "INBOX"
  172. #define DF_SIGNATURE_FILE         ".signature"
  173. #define DF_ELM_STYLE_SAVE         "no"
  174. #define DF_HEADER_IN_REPLY        "no"
  175. #define DF_OLD_STYLE_REPLY        "no"
  176. #define DF_USE_ONLY_DOMAIN_NAME   "no"
  177. #define DF_FEATURE_LEVEL          "sapling"
  178. #define DF_SAVE_BY_SENDER         "no"
  179. #define DF_SORT_KEY               "arrival"
  180. #define DF_AB_SORT_RULE           "fullname-with-lists-last"
  181. #define DF_SAVED_MSG_NAME_RULE    "default-folder"
  182. #define DF_FCC_RULE               "default-fcc"
  183. #define DF_STANDARD_PRINTER       "lp"
  184. #define ANSI_PRINTER              "attached-to-ansi"
  185. #define DF_ADDRESSBOOK            ".addressbook"
  186. #define DF_BUGS_FULLNAME          "Pine Developers"
  187. #define DF_BUGS_ADDRESS           "pine-bugs@cac.washington.edu"
  188. #define DF_SUGGEST_FULLNAME       "Pine Developers"
  189. #define DF_SUGGEST_ADDRESS        "pine-suggestions@cac.washington.edu"
  190. #define DF_PINEINFO_FULLNAME      "Pine-Info News Group"
  191. #define DF_PINEINFO_ADDRESS       "pine-info@cac.washington.edu"
  192. #define DF_LOCAL_FULLNAME         "Local Support"
  193. #define DF_LOCAL_ADDRESS          "postmaster"
  194. #define DF_KBLOCK_PASSWD_COUNT    "1"
  195.  
  196. /*----------------------------------------------------------------------
  197.    The default printer when pine starts up for the first time with no printer
  198.  ----*/
  199. #define DF_DEFAULT_PRINTER        ANSI_PRINTER
  200.  
  201.  
  202.  
  203. /*----------------------------------------------------------------------
  204.  
  205.    OS dependencies, SysVRel4 version.  See also the os-sv4.c files.
  206.    The following stuff may need to be changed for a new port, but once
  207.    the port is done, it won't change.  At the bottom of the file are a few
  208.    constants that you may want to configure differently than they
  209.    are configured, but probably not.
  210.  
  211.  ----*/
  212.  
  213.  
  214.  
  215. /*----------------- Are we ANSI? ---------------------------------------*/
  216. /* #define ANSI          /* this is an ANSI compiler */
  217.  
  218.  
  219. /*------ If our compiler doesn't understand type void ------------------*/
  220. /* #define void char     /* no void in compiler */
  221.  
  222.  
  223. FILE *tmpfile();
  224.  
  225.  
  226. /*------- Some more includes that should usually be correct ------------*/
  227. #include <pwd.h>
  228. #include <sys/wait.h>
  229. #include <sys/stat.h>
  230. #include <fcntl.h>
  231. #include <netdb.h>
  232.  
  233.  
  234.  
  235. /*----------------- locale.h -------------------------------------------*/
  236. #include <locale.h>  /* To make matching and sorting work right */
  237.  
  238.  
  239.  
  240. /*----------------- time.h ---------------------------------------------*/
  241. #include <time.h>
  242. /* plain time.h isn't enough on some systems */
  243. #include <sys/time.h>  /* For struct timeval usually in time.h */ 
  244.  
  245.  
  246.  
  247. /*--------------- signal.h ---------------------------------------------*/
  248. #include <signal.h>      /* sometimes both required, sometimes */
  249. /* #include <sys/signal.h>  /* only one or the other */
  250.  
  251. #define SigType void     /* value returned by sig handlers is void */
  252. /* #define SigType int      /* value returned by sig handlers is int */
  253.  
  254. /* #define POSIX_SIGNALS    /* use POSIX signal semantics (ttyin.c) */
  255. #define SYSV_SIGNALS    /* use System-V signal semantics (ttyin.c) */
  256.  
  257.  
  258.  
  259.  
  260. /*-------------- A couple typedef's for integer sizes ------------------*/
  261. typedef unsigned int usign32_t;
  262. typedef unsigned short usign16_t;
  263.  
  264.  
  265.  
  266. /*-------------- qsort argument type -----------------------------------*/
  267. #define QSType void  /* qsort arg is of type void * */
  268. /* #define QSType char  /* qsort arg is of type char * */
  269.  
  270.  
  271.  
  272. /*-------------- fcntl flag to set non-blocking IO ---------------------*/
  273. #define    NON_BLOCKING_IO    O_NONBLOCK        /* POSIX style */
  274. /*#define    NON_BLOCKING_IO    FNDELAY        /* good ol' bsd style  */
  275.  
  276.  
  277.  
  278. /*------ how help text is referenced (always char ** on Unix) ----------*/
  279. #define HelpType char **
  280. #define NO_HELP (char **)NULL
  281.  
  282.  
  283.  
  284. /*
  285.  * Choose one of the following three terminal drivers
  286.  */
  287.  
  288. /*--------- Good 'ol BSD -----------------------------------------------*/
  289. /* #include <sgtty.h>      /* BSD-based systems */
  290.  
  291. /*--------- System V terminal driver -----------------------------------*/
  292. /* #define HAVE_TERMIO     /* this is for pure System V */
  293. /* #include <termio.h>     /* Sys V */
  294.  
  295. /*--------- POSIX terminal driver --------------------------------------*/
  296. #define HAVE_TERMIOS    /* this is an alternative */
  297. #include <termios.h>    /* POSIX */
  298.  
  299.  
  300.  
  301. /*-------- Use poll system call instead of select ----------------------*/
  302. #define USE_POLL        /* use the poll() system call instead of select() */
  303.  
  304.  
  305.  
  306. /*-------- Use terminfo database instead of termcap --------------------*/
  307. /* #define USE_TERMINFO    /* use terminfo instead of termcap */
  308.  
  309.  
  310.  
  311. /*-- What argument does wait(2) take? Define this if it is a union -----*/
  312. /* #define HAVE_WAIT_UNION        /* the arg to wait is a union wait * */
  313.  
  314.  
  315.  
  316. /*-------- Is window resizing available? -------------------------------*/
  317. #if defined(TIOCGWINSZ) && defined(SIGWINCH)
  318. #define RESIZING  /* SIGWINCH and friends */
  319. #endif
  320.  
  321.  
  322.  
  323. /*-------- If no vfork (or fork is cheap), use regular fork ------------*/
  324. #define vfork fork
  325.  
  326.  
  327.  
  328. /*----- The usual sendmail configuration for sending mail on Unix ------*/
  329. #define SENDMAIL    "/usr/lib/sendmail"
  330. #define SENDMAILFLAGS    "-bs -odb -oem"    /* send via smtp with backgroud
  331.                        delivery and mail back errors */
  332.  
  333.  
  334. /*----------------------------------------------------------------------
  335.    If no nntp-servers are defined, this program will be used to post news.
  336.  ----*/
  337. /* #define SENDNEWS    "/usr/local/bin/inews -h"    /* news posting cmd */
  338.  
  339.  
  340. /*--------- Program employed by users to change their password ---------*/
  341. #define    PASSWD_PROG    "/bin/passwd"
  342.  
  343.  
  344. /*-------------- A couple constants used to size arrays ----------------*/
  345. #include <sys/param.h>          /* Get it from param.h if available */
  346. #undef MAXPATH                  /* Sometimes defined in param.h differently */
  347. #define MAXPATH MAXPATHLEN      /* Longest pathname we ever expect */
  348. /* #define MAXPATH        (512)    /* Longest pathname we ever expect */
  349. #define MAXFOLDER      (64)     /* Longest foldername we ever expect */  
  350.  
  351.  
  352. /*-- Max screen pine will display on. Used to define some array sizes --*/
  353. #define MAX_SCREEN_COLS  (170) 
  354. #define MAX_SCREEN_ROWS  (200) 
  355.  
  356.  
  357. /*---- When no screen size can be discovered this is the size used -----*/
  358. #define DEFAULT_LINES_ON_TERMINAL    (24)
  359. #define DEFAULT_COLUMNS_ON_TERMINAL    (80)
  360.  
  361.  
  362. /*----------------------------------------------------------------------
  363.     Where to put the output of pine in debug mode. Files are created
  364.  in the user's home directory and have a number appended to them when
  365.  there is more than one.
  366.  ----*/
  367. #define DEBUGFILE    ".pine-debug"
  368.  
  369. /*----------------------------------------------------------------------
  370.     The number of debug files to save in the user's home diretory. The files
  371.  are useful for figuring out what a user did when he complains that something
  372.  went wrong. It's important to keep a bunch around, usually 4, so that the
  373.  debug file in question will still be around when the problem gets 
  374.  investigated. Users tend to go in and out of Pine a few times and there
  375.  is one file for each pine invocation
  376.  ----*/
  377. #define NUMDEBUGFILES 4
  378.  
  379. /*----------------------------------------------------------------------
  380.    The default debug level to set (approximate meanings):
  381.        1 logs only highest level events and errors
  382.        2 logs events like file writes
  383.        3
  384.        4 logs each command
  385.        5
  386.        6 
  387.        7 logs details of command execution (7 is highest to run any production)
  388.        8
  389.        9 logs gross details of command execution
  390.  ----*/
  391. #define DEFAULT_DEBUG 2
  392.  
  393.  
  394.  
  395. /*----------------------------------------------------------------------
  396.     Various maximum field lengths, probably shouldn't be changed.
  397.  ----*/
  398. #define MAX_FULLNAME     (100) 
  399. #define MAX_NICKNAME      (40)
  400. #define MAX_ADDRESS      (200)
  401. #define MAX_NEW_LIST     (500)  /* Max addrs to be added when creating list */
  402. #define MAX_SEARCH       (100)  /* Longest string to search for             */
  403. #define MAX_ADDR_EXPN   (1000)  /* Longest expanded addr                    */
  404. #define MAX_ADDR_FIELD (10000)  /* Longest fully-expanded addr field        */
  405.  
  406.  
  407. #endif /* _OS_INCLUDED */
  408.